<?php
use common\service\StaticService;
use backend\assets\AdminAsset;
use common\service\GlobalUrlService;

StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/admin/get-info.js'),AdminAsset::class);
$class = [
  1 => 'contbox',
  2 => 'contbox2',
  3 => 'contbox3',
];

?>

<div class="layui-card">
    <div class="layui-card-header">个人信息</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <label class="layui-form-label"><?= $admin['username']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <label class="layui-form-label"><?= $admin['email']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">最近登录时间</label>
                <label class="layui-form-label"><?= $admin['last_time']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">最近登录IP</label>
                <label class="layui-form-label"><?= $admin['last_ip']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">权限</label>
                <div class="layui-inline" style="margin-left:80px;">
                    <?php foreach ($perms as $val):?>
                        <div class="<?= isset($class[$val['level']]) ? $class[$val['level']] :''?>">
                            <input type="checkbox" lay-skin="primary" <?php if($val['checked'] == true ){ echo 'checked';}?> disabled title="<?= $val['menu_name']?>">
                        </div>
                    <?php endforeach;?>

                </div>
            </div>
            <div class="layui-form-item">
                <a class="layui-btn layui-btn-primary" onclick="window.history.go(-1);">返回</a>
            </div>
        </div>
    </div>
</div>

<style>
    .layui-form-label{width:180px;}
    .contbox{padding-left: 30px;}
    .contbox2{ padding-left: 60px;}
    .contbox3{padding-left: 90px;}
    span{color:#000!important;}
</style>
